package kz.edu.sdu.itech.pcs.client;

public class Client {

   String host = "localhost";
   int port = 4444;
   String name = "client-" + Math.random();
   WorkerProtocol protocol;
   WorkerClient client;

   public Client(String name) {
      this.name = name;
   }

   public void close() {
      protocol.close();
   }

   public void init() {
      try {
         client = new WorkerClient();
         client.setTitle(name);
         protocol = new WorkerProtocol(client, host, port);
         protocol.start();
      } catch (Exception e) {
         e.printStackTrace();
      }
   }

}
